/**
 * Created by hasee on 2017/7/4.
 */
import React from 'react';
import {IfDispatcher} from "../dispatcher/dispatcher";
import {zzltestStore} from "../store/zzlteststore";
export var App = React.createClass({
    contextTypes: {
        router: React.PropTypes.object.isRequired,
    },
    getInitialState(){
        return {
        }
    },
    componentDidMount(){
       this.token=zzltestStore.addListener(this._onChange);
    },
    componentWillUnmount(){
        zzltestStore.remove(this.token);
    },
    _onChange(){
        this.setState({a:1});
    },
    render(){
        return(
            <div>

                {
                    this.props.children && React.cloneElement(this.props.children,
                        {
                            zzldata:zzltestStore.getData()
                        })
                }
            </div>
        )
    }
});